
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="java.util.Iterator" %>
<%@page import="java.util.ArrayList" %>
<%@page import="logic.CharRecord" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<jsp:useBean id="countBean" scope="request" class="logic.CounterBean" />
<jsp:setProperty name="countBean" property="message" value='<%=request.getParameter("message")%>' />

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Character Count</title>
    </head>
    <body>
        <%
        ArrayList<CharRecord> counters;
        counters = countBean.getCounters();
        Iterator<CharRecord> itr = counters.iterator();
        while(itr.hasNext()){
        CharRecord record = itr.next();
        %>
            <%=record.character%> <%=record.count%><br/>
        <%
        }
        %>
    </body>
</html>
